from turtle import forward
from nets.bases.basicmodel import BasicModule
import torch as t
import torch.nn as nn
import torch.nn.functional as F


class DilatedConv(nn.Module):
        
    def __init__(self, inplace, outplace, dilation_rate, stride, kernel_size, padding):
        super(DilatedConv, self).__init__()
        
        # padding = ((in_size  - 1) * stride + kernel_size - in_size) // 2
        
        self.model = nn.Sequential(
            nn.Conv2d(inplace, outplace, kernel_size, stride=stride, padding=padding, dilation=dilation_rate, bias=False),
            nn.BatchNorm2d(outplace),
            nn.ReLU(inplace = True),
        )
        
    
    def forward(self, x):
        x = self.model(x)
        return x